【FPGA/verilog -入门学习17】vivado 实现串口自发自收程序

1,需求

PC使用串口助手给FPGA板发送9600 波特率的数据,FPGA板接收到数据后,回复同样的数据给PC

2,需求分析

按模块可以划分为:

rx接收模块,将输入的8位并行rx 数据转换成[7:0]rx_data 信号,当数据接收完成后,同时生成一个rx_done 信号。

bsp_generate_clk_en:接收波特率时钟产生模块,当rx接收到数据时,给一个start信号给波特率时钟产生模块,由bsp时钟产生模块按9600波特率产生时钟使能信号bsp_generate_clk_en 用于同步rx 接收模块接收数据的时序。

tx发送模块:当接收到来子rx 接收模块发过来的rx_done 信号后,将[7:0]rx_data 的数据按波特率时钟产生模块的顺序依次发送出去。

bsp_generate_clk_en:发送波特率时钟产生模块,功能同接收模块

3,绘制框图和时序图

4,编写发送tx 模块,并编写行为测试模块代码测试其功能


`timescale 1ns/1psmodule testbench_top();//参数定义`define CLK_PERIORD        20        //时钟周期设置为20ns(50MHz)    //接口申明
reg i_clk;
reg i_rest_n;wire o_uart_tx;
wire o_uart_tx_done;vlg_design vlg_design_inst(.i_clk(i_clk),.i_rest_n(i_rest_n),.o_uart_tx(o_uart_tx),.o_uart_tx_done(o_uart_tx_done));initial begini_clk <= 0;
i_rest_n <= 0;
#20;
i_rest_n <= 1;#2_000_000_000;
$stop;endalways #(`CLK_PERIORD/2) i_clk = ~i_clk;endmodule
//my_uart_tx
//put o_rx_data to i_uart_tx`timescale 1ns/1ps
module vlg_1ms(input i_clk,  //25Mhzinput i_rest_n,output [7:0]o_data, output reg tx_en);localparam CNT_1MS_MAX = 25*2000 - 1;wire clk_25m;
wire clk_12r5m;
wire clk_100m;
wire locked;clk_wiz_0 instance_name
(// Clock out ports.clk_out1(clk_25m),     // output clk_out1.clk_out2(clk_12r5m),     // output clk_out2.clk_out3(clk_100m),     // output clk_out3// Status and control signals.reset(!i_rest_n), // input reset.locked(locked),       // output locked// Clock in ports.clk_in1(i_clk) // input clk_in1
);      // 每隔1ms 产生一个 tx_en 上升沿脉冲  
reg [15:0] r_cnt_1ms;    
always @(posedge i_clk) beginif(!i_rest_n) r_cnt_1ms <= 0;else if(r_cnt_1ms < CNT_1MS_MAX)  r_cnt_1ms <= r_cnt_1ms + 1;else r_cnt_1ms <= 0;
end    always @(posedge i_clk) beginif(!i_rest_n) tx_en <= 0;else if(r_cnt_1ms == CNT_1MS_MAX)  tx_en <= 1;else tx_en <= 0;
end    
reg [7:0]r_data;
// 每隔1ms ,data = 0000_0001 自增 
always @(posedge i_clk) beginif(!i_rest_n)  r_data <= 0;else if(r_data == 100) r_data <= 0;else if(r_cnt_1ms == CNT_1MS_MAX) r_data <= r_data+1;else ;endassign o_data = r_data;endmodule
//my_uart_tx
//put o_rx_data to i_uart_tx`timescale 1ns/1ps
module vlg_design(input i_clk,  //25Mhzinput i_rest_n,output  o_uart_tx,    output  o_uart_tx_done );wire clk_25m;
wire clk_12r5m;
wire clk_100m;
wire locked;wire tx_bps_start;
wire o_bps_clk_en;wire [7:0]w_data;
wire w_tx_en;clk_wiz_0 instance_name(// Clock out ports.clk_out1(clk_25m),     // output clk_out1.clk_out2(clk_12r5m),     // output clk_out2.clk_out3(clk_100m),     // output clk_out3// Status and control signals.reset(!i_rest_n), // input reset.locked(locked),       // output locked// Clock in ports.clk_in1(i_clk));      // input clk_in1//对被测试的设计进行例化vlg_speed_generate        vlg_speed_generate_inst(.i_clk(clk_25m),.i_rest_n(i_rest_n),.i_bps_start(tx_bps_start),.o_bps_clk_en(o_bps_clk_en) );    ///vlg_my_uart_tx vlg_my_uart_tx_inst(.i_clk(clk_25m),.i_rest_n(i_rest_n),.i_uart_tx_bps_en(o_bps_clk_en),.i_rx_data(w_data),.tx_en(w_tx_en),.tx_bps_start(tx_bps_start),.o_uart_tx(o_uart_tx),.o_uart_tx_done(o_uart_tx_done));///vlg_1ms vlg_1ms_inst(.i_clk(clk_25m),.i_rest_n(i_rest_n),.o_data(w_data),.tx_en(w_tx_en));endmodule

//my_uart_tx
//put o_rx_data to i_uart_tx`timescale 1ns/1ps
module vlg_my_uart_tx(input i_clk,  //25Mhzinput i_rest_n,input i_uart_tx_bps_en, input [7:0]i_rx_data, input tx_en,output reg tx_bps_start,output reg o_uart_tx,    output reg o_uart_tx_done);reg [3:0]txdata_cnt;    //检测tx_en 的高电平脉冲
//检测到高脉冲 tx_bps_start 置1
//当数据发送完成,即start,D0~D7,Stop .txdata_cnt = 10 时结束tx_bps_start 置0reg [1:0]r_tx_en_plus;
wire w_tx_en_pos;always @(posedge i_clk) beginif(!i_rest_n) r_tx_en_plus <= 2'b00;else r_tx_en_plus <= {r_tx_en_plus[0],tx_en};
endassign w_tx_en_pos = r_tx_en_plus[0]& ~r_tx_en_plus[1];//产生 tx_bps_start
always @(posedge i_clk) begin
if(!i_rest_n) tx_bps_start <= 0;
else if(txdata_cnt == 11) tx_bps_start <= 0;
else if(w_tx_en_pos) tx_bps_start <= 1;
end//txdata_cnt 计数 0~10 
always @(posedge i_clk) begin
if(!i_rest_n) txdata_cnt <= 0;
else if(txdata_cnt == 11)  txdata_cnt <= 0;
else if(i_uart_tx_bps_en) txdata_cnt <= txdata_cnt + 1;
end//发出o_uart_tx
wire [9:0]w_data_10 = {1'b1,i_rx_data,1'b0}; // 1,d7,d6,d5,d4,d3,d2,d1,d0,0
always @(posedge i_clk) beginif(!i_rest_n) o_uart_tx <= 1;else if(i_uart_tx_bps_en)  begin case (txdata_cnt)0: o_uart_tx <= w_data_10[0];1: o_uart_tx <= w_data_10[1];2: o_uart_tx <= w_data_10[2];3: o_uart_tx <= w_data_10[3];4: o_uart_tx <= w_data_10[4];5: o_uart_tx <= w_data_10[5];6: o_uart_tx <= w_data_10[6];7: o_uart_tx <= w_data_10[7];8: o_uart_tx <= w_data_10[8];9: o_uart_tx <= w_data_10[9];10: o_uart_tx <= 1;default : o_uart_tx <= 1;endcase end
end//o_uart_tx_done
always @(posedge i_clk) begin
if(!i_rest_n) o_uart_tx_done <= 0;
else if(txdata_cnt == 11)  o_uart_tx_done <= 1;
else  o_uart_tx_done <= 0;
endendmodule
 
`timescale 1ns/1ps
module vlg_speed_generate(input i_clk,  //input 25Mhzinput i_rest_n,input i_bps_start,output reg o_bps_clk_en);localparam bpsrate = 115200;
localparam BPS_COUNT_MAX = 1*25*1000_000/bpsrate - 1;
localparam BPS_COUNT_MAX_DIV_2 = 1*25*1000_000/bpsrate/2-1;reg [11:0]bsp_cnt;always @(posedge i_clk) begin
if(!i_rest_n) bsp_cnt <= 0;
else if(!i_bps_start) bsp_cnt <= 0;
else if(bsp_cnt < BPS_COUNT_MAX)  bsp_cnt <= bsp_cnt+1;else bsp_cnt <= 0;
endalways @(posedge i_clk) beginif(!i_rest_n) o_bps_clk_en <= 0;else if (bsp_cnt == BPS_COUNT_MAX_DIV_2)  o_bps_clk_en <= 1;else o_bps_clk_en <= 0;
endendmodule

仿真波形

5,编写RX接收模块,并编写行为测试模块代码测试其功能


`timescale 1ns/1psmodule testbench_top();//参数定义`define CLK_PERIORD        20        //时钟周期设置为20ns(50MHz)    //接口申明
reg [7:0]data;
reg i_clk;
reg i_rest_n;
reg i_rx;wire o_uart_tx;
wire o_uart_tx_done;wire i_uart_rx_bps_en;
wire [7:0]o_rx_data;
wire o_rx_start;
wire o_uart_rx_done;wire locked;clk_wiz_0 instance_name(// Clock out ports.clk_out1(clk_25m),     // output clk_out1.clk_out2(clk_12r5m),     // output clk_out2.clk_out3(clk_100m),     // output clk_out3// Status and control signals.reset(!i_rest_n), // input reset.locked(locked),       // output locked// Clock in ports.clk_in1(i_clk));      // input clk_in1vlg_my_uart_rx vlg_my_uart_rx_inst(.i_clk(clk_25m),.i_rest_n(i_rest_n),.i_rx(i_rx),.i_uart_rx_bps_en(i_uart_rx_bps_en),.o_rx_data(o_rx_data),.o_rx_start(o_rx_start),.o_uart_rx_done(o_uart_rx_done)); vlg_speed_generate        vlg_speed_generate_inst(.i_clk(clk_25m),.i_rest_n(i_rest_n),.i_bps_start(o_rx_start),.o_bps_clk_en(i_uart_rx_bps_en) );    integer i;initial begini_rx <= 1;
i_clk <= 0;
i_rest_n <= 0;
#20;
i_rest_n <= 1;
data <= 8'b0101_0101;  endalways #(`CLK_PERIORD/2) i_clk = ~i_clk;initial begin@(posedge i_clk);
@(posedge i_rest_n);
#2000_000;
i_rx <= 0;
#10_4166;  //等待1个时钟 1_000_000_000 / 9600for(i = 0;i<8;i=i+1) begin i_rx <= data[i];#10_4166;
end
i_rx <= 1;
#10_4166;
#2000_000;data <= 8'b0000_0101;  
i_rx <= 0;
#10_4166;  //等待1个时钟 1_000_000_000 / 9600for(i = 0;i<8;i=i+1) begin i_rx <= data[i];#10_4166;
end
i_rx <= 1;
#10_4166;
#2000_000;data <= 8'b1111_0000;  
i_rx <= 0;
#10_4166;  //等待1个时钟 1_000_000_000 / 9600for(i = 0;i<8;i=i+1) begin i_rx <= data[i];#10_4166;
end
i_rx <= 1;
#10_4166;
#2000_000;data <= 8'b0000_1111;  
i_rx <= 0;
#10_4166;  //等待1个时钟 1_000_000_000 / 9600for(i = 0;i<8;i=i+1) begin i_rx <= data[i];#10_4166;
end
i_rx <= 1;
#10_4166;
#2000_000;$stop;endendmodule
//my_uart_tx
//put rx_data to i_uart_tx`timescale 1ns/1ps
module vlg_design(input i_clk,  //25Mhzinput i_rest_n,input i_rx,output o_tx
);wire o_uart_tx;
wire o_uart_tx_done;
wire i_uart_rx_bps_en;
(*mark_debug = "true"*)wire [7:0]o_rx_data;
wire o_rx_start;
(*mark_debug = "true"*)wire o_uart_rx_done;
wire locked;wire clk_25m;
wire clk_12r5m;
wire clk_100m;
wire locked;wire tx_bps_start;
wire i_uart_tx_bps_en;//灏唕x_data 杞垚 tx ///vlg_my_uart_tx vlg_my_uart_tx_inst(.i_clk(clk_25m),.i_rest_n(i_rest_n),.i_uart_tx_bps_en(i_uart_tx_bps_en),.i_rx_data(o_rx_data),.tx_en(o_uart_rx_done),.tx_bps_start(tx_bps_start),.o_uart_tx(o_tx),.o_uart_tx_done(o_uart_tx_done));vlg_speed_generate        vlg_speed_generate_tx_inst(.i_clk(clk_25m),.i_rest_n(i_rest_n),.i_bps_start(tx_bps_start),.o_bps_clk_en(i_uart_tx_bps_en) );    //浜х敓rx 杞琩ata鏁版嵁
vlg_my_uart_rx vlg_my_uart_rx_inst(.i_clk(clk_25m),.i_rest_n(i_rest_n),.i_rx(i_rx),.i_uart_rx_bps_en(i_uart_rx_bps_en),.o_rx_data(o_rx_data),.o_rx_start(o_rx_start),.o_uart_rx_done(o_uart_rx_done)
); vlg_speed_generate        vlg_speed_generate_rx_inst(.i_clk(clk_25m),.i_rest_n(i_rest_n),.i_bps_start(o_rx_start),.o_bps_clk_en(i_uart_rx_bps_en) );    // 浜х敓鏃堕挓淇″彿clk_wiz_0 instance_name(// Clock out ports.clk_out1(clk_25m),     // output clk_out1.clk_out2(clk_12r5m),     // output clk_out2.clk_out3(clk_100m),     // output clk_out3// Status and control signals.reset(!i_rest_n), // input reset.locked(locked),       // output locked// Clock in ports.clk_in1(i_clk));      // input clk_in1endmodule
//my_uart_tx
//put o_rx_data to i_uart_tx`timescale 1ns/1ps
module vlg_my_uart_rx(input i_clk,  //25Mhzinput i_rest_n,input(*mark_debug = "true"*) i_rx,  //杈撳叆 input i_uart_rx_bps_en, output  [7:0]o_rx_data, output reg o_rx_start,output reg o_uart_rx_done);reg [3:0]rxdata_cnt;    
wire w_rx_pos;
reg  r_rx_start_pos;
reg [1:0]rx_plus;always @(posedge i_clk) beginif(!i_rest_n)  rx_plus <= 2'b00;else rx_plus <= {rx_plus[0],i_rx};
end    assign w_rx_pos = ~rx_plus[0] & rx_plus[1];// 鎵?鏈塺x 涓嬮檷娌?///
//浜х敓 r_rx_start_pos 鑴夊啿锛屽綋rx 绗竴娆? = 0鏃讹紝杈撳嚭楂樼數骞筹紝鍏朵粬鏃跺埢鎷変綆
always @(posedge i_clk) beginif(!i_rest_n) r_rx_start_pos <= 0;else if(rxdata_cnt == 0) r_rx_start_pos <= w_rx_pos;else r_rx_start_pos <= 0;end    //妫?娴嬪埌 rx 1涓剦鍐茬殑涓嬮檷娌匡紝琛ㄧず淇″彿寮?濮嬶紝鎶?鏈粨鏉燂紝瀹屾垚
//o_rx_start
always @(posedge i_clk) beginif(!i_rest_n) o_rx_start <= 0;else if(rxdata_cnt == 11)o_rx_start <= 0;else if(r_rx_start_pos) o_rx_start <= 1;else  ;
end//浜х敓rxdata_cnt璁℃暟
always @(posedge i_clk) beginif(!i_rest_n) rxdata_cnt <= 0;else if (rxdata_cnt == 11) rxdata_cnt <= 0;else if(i_uart_rx_bps_en)rxdata_cnt <= rxdata_cnt + 1;else ;
endreg [7:0]r_rx_data;    
//鏀堕泦鏁版嵁
always @(posedge i_clk) beginif(!i_rest_n) r_rx_data <= 8'b0000_0000;  else if(i_uart_rx_bps_en)   case (rxdata_cnt)4'd0:    ;//start4'd1:    r_rx_data[0] <= i_rx;4'd2:    r_rx_data[1] <= i_rx;4'd3:    r_rx_data[2] <= i_rx;4'd4:    r_rx_data[3] <= i_rx;4'd5:    r_rx_data[4] <= i_rx;4'd6:    r_rx_data[5] <= i_rx;4'd7:    r_rx_data[6] <= i_rx;4'd8:    r_rx_data[7] <= i_rx;4'd9:;//stop4'd10:;//nonedefault:;//noneendcase end    assign o_rx_data= (rxdata_cnt == 11)?r_rx_data:o_rx_data;//浜х敓o_uart_rx_done
always @(posedge i_clk) beginif(!i_rest_n)  o_uart_rx_done <= 0;else if(rxdata_cnt == 11) o_uart_rx_done <= 1;else o_uart_rx_done <= 0;  
end
endmodule

6,配置IO端口,生成bit文件烧录到板子测试

7,问题1:2024年1月10日

发送单个数据没有问题,但是连发出现异常数据。

对比代码发现例程代码的发送数据,结束位并没有保持1个bsp的完整高电平,而是只保持了一个脉冲的电平

修改代码后,测试ok

//my_uart_tx
//put o_rx_data to i_uart_tx`timescale 1ns/1ps
module vlg_my_uart_tx(input i_clk,  //25Mhzinput i_rest_n,input i_uart_tx_bps_en, input [7:0]i_rx_data, input tx_en,output reg tx_bps_start,output reg o_uart_tx,    output reg o_uart_tx_done);reg [3:0]txdata_cnt;    //检测tx_en 的高电平脉冲
//检测到高脉冲 tx_bps_start 置1
//当数据发送完成,即start,D0~D7,Stop .txdata_cnt = 10 时结束tx_bps_start 置0reg [1:0]r_tx_en_plus;
wire w_tx_en_pos;always @(posedge i_clk) beginif(!i_rest_n) r_tx_en_plus <= 2'b00;else r_tx_en_plus <= {r_tx_en_plus[0],tx_en};
endassign w_tx_en_pos = r_tx_en_plus[0]& ~r_tx_en_plus[1];//产生 tx_bps_start
always @(posedge i_clk) begin
if(!i_rest_n) tx_bps_start <= 0;
else if(txdata_cnt == 10) tx_bps_start <= 0;
else if(w_tx_en_pos) tx_bps_start <= 1;
end//txdata_cnt 计数 0~10 
always @(posedge i_clk) begin
if(!i_rest_n) txdata_cnt <= 0;
else if(txdata_cnt == 10)  txdata_cnt <= 0;
else if(i_uart_tx_bps_en) txdata_cnt <= txdata_cnt + 1;
end//发出o_uart_tx
wire [9:0]w_data_10 = {1'b1,i_rx_data,1'b0}; // 1,d7,d6,d5,d4,d3,d2,d1,d0,0
always @(posedge i_clk) beginif(!i_rest_n) o_uart_tx <= 1;else if(i_uart_tx_bps_en)  begin case (txdata_cnt)0: o_uart_tx <= w_data_10[0];1: o_uart_tx <= w_data_10[1];2: o_uart_tx <= w_data_10[2];3: o_uart_tx <= w_data_10[3];4: o_uart_tx <= w_data_10[4];5: o_uart_tx <= w_data_10[5];6: o_uart_tx <= w_data_10[6];7: o_uart_tx <= w_data_10[7];8: o_uart_tx <= w_data_10[8];9: o_uart_tx <= w_data_10[9];default : o_uart_tx <= 1;endcase end
end//o_uart_tx_done
always @(posedge i_clk) beginif(!i_rest_n) o_uart_tx_done <= 0;else if(txdata_cnt == 10)  o_uart_tx_done <= 1;else  o_uart_tx_done <= 0;
end
endmodule

8,问题2:{} 数据合并要加上前缀

wire [9:0]w_data_10 = {1,i_rx_data,0}; //错误

wire [9:0]w_data_10 = {1'b1,i_rx_data,1'b0}; //正确

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/336963.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

wireshark使用教程

目录 windows平台安装Wireshark组件选择Additional TasksPacket CaptureUSB CaptureNpcap Installation Options Ubuntu上安装 Wireshark不使用 sudo 运行 Wireshark 使用GUI抓包使用命令行抓包确定抓取哪个网卡的报文抓取数据包停止抓包设置过滤条件 参考资料 Wireshark 是一款…

Leetcode242有效的字母异位词(java实现,详细易懂想学会的进!!!)

今天给大家分享的题目是leetcode242有效的字母异位词 我们先看题目描述&#xff1a; Chatgpt中对于字母异位词的解释如下&#xff1a; 字母异位词是指由相同的字母组成但顺序不同的单词。换句话说&#xff0c;字母异位词具有相同的字母&#xff0c;只是排列顺序不同。 简单的将…

AirBrush - AI 照片编辑器

​【应用名称】&#xff1a;AirBrush - AI 照片编辑器 ​【适用平台】&#xff1a;#Android ​【软件标签】&#xff1a;#AirBrush ​【应用版本】&#xff1a;6.0.1 ​【应用大小】&#xff1a;270MB ​【软件说明】&#xff1a;谁说我们的照片不能完美&#xff1f;我们相信…

生成式人工智能市场规模、趋势和统计数据(2024-2026)

生成式人工智能市场规模、趋势和统计数据&#xff08;2024-2026&#xff09; 目录 生成式人工智能市场规模、趋势和统计数据&#xff08;2024-2026&#xff09;一、生成式人工智能行业亮点二、生成式人工智能市场规模三、生成式人工智能市场增长预测四、生成式人工智能采用统计…

imgaug库指南(13):从入门到精通的【图像增强】之旅

引言 在深度学习和计算机视觉的世界里&#xff0c;数据是模型训练的基石&#xff0c;其质量与数量直接影响着模型的性能。然而&#xff0c;获取大量高质量的标注数据往往需要耗费大量的时间和资源。正因如此&#xff0c;数据增强技术应运而生&#xff0c;成为了解决这一问题的…

基于深度学习的老照片修复系统

技术栈 深度学习 pytorch tensorflow python 卷积神经 神经网络 照片修复 vue 老照片修复 扫描褪色 残损照片或胶片 调整暗调/高光以改善面效果 修正曝光斑痕 背景&#xff1a; 随着时间的流逝&#xff0c;许多老照片可能会褪色、损坏或曝光不当。这些老照片记录了宝贵的回忆…

HelpLook VS Docusaurus:SaaS 知识库软件和 SSG 的对比

在选择文档工具时&#xff0c;需要考虑多个因素&#xff0c;如功能、易用性、成本等。Docusaurus是一个开源工具&#xff0c;它因其灵活性而受到文档团队的青睐&#xff0c;尤其是负责软件产品文档的团队。有些组织甚至可能要求使用开源软件&#xff0c;因此选择一个开源工具如…

【算法刷题】Day28

文章目录 1. 买卖股票的最佳时机 III题干&#xff1a;算法原理&#xff1a;1. 状态表示&#xff1a;2. 状态转移方程3. 初始化4. 填表顺序5. 返回值 代码&#xff1a; 2. Z 字形变换题干&#xff1a;算法原理&#xff1a;1. 模拟2. 找规律 代码&#xff1a; 1. 买卖股票的最佳时…

MySQL:ERROR 1067 - Invalid default value for ‘end_time‘【解决办法】

问题描述&#xff08;mysql版本&#xff1a;5.7.36&#xff09;&#xff1a; 今天在使用Navicat可视化工具运行sql文件&#xff0c;发生如下错误&#xff1a; 在图中&#xff0c;sql是没有错误的&#xff0c;但是运行报错Invalid default value for end_time。 解决办法&#…

基于图像合成和注意力的深度神经网络从计算机断层扫描灌注图像中自动分割缺血性脑卒中病变

Automatic ischemic stroke lesion segmentation from computed tomography perfusion images by image synthesis and attention-based deep neural networks 基于图像合成和注意力的深度神经网络从计算机断层扫描灌注图像中自动分割缺血性脑卒中病变背景贡献实验Comparison o…

2.doris数据类型与分区

用户创建与授权 -- 创建用户 create user test identified by test; -- 创建数据库 create database test_db; -- 授权用户 grant all on test_db to test;建表语法 CREATE [EXTERNAL] TABLE [IF NOT EXISTS] [database.]table_name(column_definition1[, column_definition2…

linux复习笔记07(兄弟连)----链接命令

创建软链接&#xff1a; 创建硬链接&#xff1a; 对比原文件详细信息和软链接详细信息&#xff1a; 我们再来对比原链接和硬链接的详细信息有什么不同&#xff1a; 我们查看一下原文件和硬链接文件内容&#xff1a; 可以看到二者内容相同。 我们现在在原文件末尾添加一行信息&…